<template>
  <div>
    首页
  </div>
</template>
<script>
export default {
  created() {
    const arr = ['aaa', 'bbb'] // 用户信息中的权限标识
    // 动态路由
    const arr2 = [
      {
        name: 'aaa1',
        path: '/aaa1',
        code: 'aaa'
      },
      {
        name: 'bbb2',
        path: '/bbb2',
        code: 'bbb'
      },
      {
        name: 'ccc3',
        path: '/ccc3'
      }
    ]
    const newArr = arr2.filter(item => {
      // return item.code是否在arr中存在
      return arr.includes(item.code)
    })
    console.log(newArr)
  }
}
</script>
<style>
</style>
